package com.yami.shop.api.controller;

import com.alibaba.fastjson.JSONObject;
import com.yami.shop.common.response.ServerResponseEntity;
import com.yami.shop.service.MeltCloudGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/discern")
public class DiscernCodeController {

    @Autowired
    private MeltCloudGroupService meltCloudGroupService;

    @GetMapping("/discernCodeByUrl")
    public ServerResponseEntity<JSONObject> discernCodeByUrl(@RequestParam("path") String path){
        // 群组识别二维码
        JSONObject jsonObject = meltCloudGroupService.discernCodeByUrl(path);
        return ServerResponseEntity.success(jsonObject);
    }
}